set -e

ssh root@test.dev.webapps.cn <<remote_shell

set -e

rm -rf /root/www/*

remote_shell

scp -r shell/docker/* root@test.dev.webapps.cn:/root/www

scp -r dist/* root@test.dev.webapps.cn:/root/www/public

ssh root@test.dev.webapps.cn <<remote_shell

set -e

docker build -t gongyezhenxing-console:latest /root/www

docker image prune -f

/root/www.sh gongyezhenxing-console

remote_shell

echo -------------------------------
echo deployed at $(date "+%Y-%m-%d %H:%M:%S")
echo -------------------------------